package com.haoliangtian.data;

import android.util.Log;

import com.haoliangtian.api.APIUtil;
import com.haoliangtian.bean.LoginResponse;
import com.haoliangtian.data.model.LoggedInUser;


import java.io.IOException;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;


/**
 * 登录相关请求
 */
public class LoginDataSource {
    /**
     * 登录方法
     *
     * @param username
     * @param password
     * @return
     */
    public Result<LoggedInUser> login(String username, String password) {

        try {

            return new Result.Success<LoginResponse>(null);

        } catch (Exception e) {
            return new Result.Error(new IOException("Error logging in", e));
        }
    }

    public void logout() {
        // TODO: revoke authentication
    }
}
